home *** CD-ROM | disk | FTP | other *** search
- Path: news.cerf.net!news
- From: Michael McKibben <mckibben@cerf.net>
- Newsgroups: comp.lang.c++
- Subject: Basic STL istream_iterator Q.
- Date: Tue, 30 Jan 1996 12:15:01 -0800
- Organization: CERFnet
- Message-ID: <310E7C45.12F2@cerf.net>
- NNTP-Posting-Host: pike.cerf.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b5 (X11; I; SunOS 5.5 sun4m)
-
- I'm having a problem using istream_iterator<T> with gcc-2.7.2 and
- gcc's libstd++.
-
- The following code works, but skips over all white space in the input
- file. What am I doing wrong?
-
- /* simple file copy */
- #include <iostream.h>
- #include <fstream.h>
- #include <stl.h>
-
- int main (int,char**) {
- ifstream if("foo.in");
- ofstream of("foo.out");
-
- copy(istream_iterator<char>(if),
- istream_iterator<char>(),
- ostream_iterator<char>(of));
-
- return 0;
- }
-
-
- -mike
- ------------------------------------
- Michael McKibben <mckibben@cerf.net>
-